package meijuli.com.join51.business.data;

/**
 * @author Scott Smith  @Date 2016年08月16/8/24日 20:16
 */
public abstract class Downloader {
    public interface OnDownloadListener {
        void onDownloadFinished(String url, String path, String vfileName);

        void onDownloading(String url, int contentLength, int currSize);

        void onDownloadStarted(String url, String path, String fileName);

        void onDownloadErr(int code, String url, String error);
    }

    public abstract void download(String url, String path, String fileName);

    public abstract void removeListener();

    public abstract void quit();

    public static Downloader newInstance(OnDownloadListener onDownloadListener) {
        return new DownloaderImpl(onDownloadListener);
    }
}